package com.easygoods.controller;

import com.bestvike.stone.spring.controller.BaseController;
import com.bestvike.stone.spring.rest.common.CommonResponse;
import com.bestvike.stone.spring.shiro.annotation.RequiresPermissions;
import com.easygoods.service.DistrictService;
import com.easygoods.shiro.auth.UserPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 许崇雷 on 2019-01-09.
 */
@RestController
@RequestMapping(value = "/api/district")
public class DistrictController extends BaseController {
    @Autowired
    private DistrictService districtService;

    @RequiresPermissions(UserPermissions.MANAGE)
    @GetMapping(value = "/init")
    public CommonResponse<Object> init() {
        this.districtService.init();
        return CommonResponse.success();
    }
}
